package array

func integerBreak(n int) int {
	dp := make([]int, n+1)
	dp[0] = 1

	for i := 1; i <= n; i++ {
		for j := 1; j <= i; j++ {
			dp[i] = max(dp[i], max((i-j)*j, dp[j]*(i-j)))
		}
	}

	return dp[n]

}
